package com.chexiehui.jc.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Author: SongJun.
 * CreateDate: 2019/2/21 0021.
 * Description: 地址实体
 */

public class AddressEntity implements Serializable {
    private String province;
    private String city;
    private String district;

    private String destinationAddress;

    private String name;
    private String phone;

    private double lat;
    private double lng;
    public AddressEntity() {
    }

    public AddressEntity(String destinationAddress) {
        this.destinationAddress = destinationAddress;
    }

    public AddressEntity(String province, String city, String district) {
        this.province = province;
        this.city = city;
        this.district = district;
    }

    public AddressEntity(String province, String city, String district, String details) {
        this.province = province;
        this.city = city;
        this.district = district;
        this.destinationAddress = details;
    }

    public AddressEntity(String province, String city, String district, String details, String postName, String postPhone) {
        this.province = province;
        this.city = city;
        this.district = district;
        this.destinationAddress = details;
        this.name = postName;
        this.phone = postPhone;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getDestinationAddress() {
        return destinationAddress;
    }

    public void setDestinationAddress(String destinationAddress) {
        this.destinationAddress = destinationAddress;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public double getLng() {
        return lng;
    }

    public void setLng(double lng) {
        this.lng = lng;
    }

    public String getAddressAll() {
        return new StringBuilder().append(province == null ? "" : province).append(city == null ? "" : city).append(district == null ? "" : district).append(destinationAddress == null ? "" : destinationAddress).toString();
    }

    public String getStartCity() {
        return new StringBuilder().append(city == null ? "" : city).append(district == null ? "" : district).toString();
    }

    public String getAddressPre() {
        return new StringBuilder().append(province == null ? "" : province).append(city == null ? "" : city).append(district == null ? "" : district).toString();
    }

    public static List<AddressEntity> createList(int count) {
        List<AddressEntity> list = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            list.add(new AddressEntity("贵州省", "贵阳市", "观赏湖区", "高新区科技大厦", "宋俊", "18786797475"));
        }
        return list;
    }

    @Override
    public String toString() {
        return "AddressEntity{" +
                "province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", district='" + district + '\'' +
                ", destinationAddress='" + destinationAddress + '\'' +
                ", name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                ", lat=" + lat +
                ", lng=" + lng +
                '}';
    }
}
